﻿using CoreModule;
using Prism.Ioc;
using Prism.Modularity;
using Prism.Regions;
using System.Windows.Controls;
using UIModule.Views;
namespace UIModule
{
    /// <summary>
    /// 
    /// </summary>
    /// 
    [Module(ModuleName = "UIModule")]
    [ModuleDependency("CoreModule")]
    public class Module : IModule
    {
        IWindowLifetime WindowLifetime;
        IRegionManager RegionManager;
        public Module(IRegionManager regionManager, IWindowLifetime windowLifetime)
        {
            RegionManager=regionManager;
            WindowLifetime = windowLifetime;
        }
        /// <summary>
        /// 
        /// </summary>
        /// <param name="containerProvider"></param>
        public void OnInitialized(IContainerProvider containerProvider)
        {
            RegionManager.RequestNavigate(CoreConstant.MainRegion, CoreConstant.MeasurementHomeView);
        }

        /// <summary>
        /// 
        /// </summary>
        /// <param name="containerRegistry"></param>
        public void RegisterTypes(IContainerRegistry containerRegistry)
        {
            containerRegistry.RegisterForNavigation<MeasurementHome>(CoreConstant.MeasurementHomeView);
            
            containerRegistry.RegisterForNavigation<MeasurementResult>(UIConstant.MeasurementResultView);
            containerRegistry.RegisterForNavigation<About>(UIConstant.AboutView);
        }
    }
}